#region Using

using System;

#endregion

namespace SemanticEngine.Apml
{
	public abstract class ItemBase : ValidationBase
	{

		#region Propeties

		private double _Rank;
		/// <summary>
		/// Gets or sets the relative rank of the concept/interest. Must be between 0 and 1.
		/// </summary>
		/// <value>The rank of the concept/interest.</value>
		public double Rank
		{
			get { return _Rank; }
			set { _Rank = value; }
		}

		private string _From;
		/// <summary>
		/// Gets or sets from where the concept/interest was specified. Usually a website URL.
		/// </summary>
		/// <value>From which place the concept/interest origin.</value>
		public string From
		{
			get { return _From; }
			set { _From = value; }
		}

		private DateTime _DateUpdated;
		/// <summary>
		/// Gets or sets the date from when the concept/interest was updated.
		/// </summary>
		/// <value>The date updated.</value>
		public DateTime DateUpdated
		{
			get { return _DateUpdated; }
			set { _DateUpdated = value; }
		}

		#endregion
		
		protected override void Validate()
		{
			AddRule("Rank", "Rank must be between 0 and 1", Rank <= 0 || Rank > 1);
		}
	}
}
